//
//  JXuanTableViewCell.m
//  ZAKER
//
//  Created by dllo on 15/8/29.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "JXuanTableViewCell.h"


@implementation JXuanTableViewCell

-(void)dealloc
{
    
    [_timeLabel release];
    [_titleLabel release];
    [_addressLabel release];
    [_MyImage release];
    
    [super dealloc];
    
}

- (void)awakeFromNib
{
   
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
      
        self.MyImage = [[[UIImageView alloc]init] autorelease];
        _MyImage.layer.masksToBounds =YES;
        [self.contentView addSubview:_MyImage];
//        [_MyImage release];
        
        
        self.titleLabel = [[[UILabel alloc]init] autorelease];
        _timeLabel.font = [UIFont systemFontOfSize:17 * myHeight];
        _titleLabel.numberOfLines = 0;
        _titleLabel.textAlignment = 1;
        [self.contentView addSubview:_titleLabel];
//        [_titleLabel release];
        
        
        self.addressLabel = [[[UILabel alloc]init] autorelease];
        [self.contentView addSubview:_addressLabel];
        _addressLabel.font = [UIFont systemFontOfSize:13 * myHeight];
        _addressLabel.textAlignment = 1;
        _addressLabel.textColor = [UIColor lightGrayColor];
//        [_addressLabel release];
        
        
        self.timeLabel = [[[UILabel alloc]init] autorelease];
        _timeLabel.backgroundColor = [UIColor blackColor];
        _timeLabel.textAlignment = 1;
        _timeLabel.font = [UIFont systemFontOfSize:13 * myHeight];
        _timeLabel.textColor = [UIColor whiteColor];
        _timeLabel.layer.cornerRadius = 10;
        _timeLabel.layer.masksToBounds = YES;
        [self.contentView addSubview:_timeLabel];
//        [_timeLabel release];
        
    }
    
    return self;
    
}


-(void)layoutSubviews
{
    
    [super layoutSubviews];
    
    self.MyImage.frame = CGRectMake(30 * myWidth, 30 * myHeight, (375 - 60) * myWidth, (375 - 60)* myWidth);
    _MyImage.layer.cornerRadius = (375 - 60) / 2 * myWidth;
    
    self.titleLabel.frame =CGRectMake(55 * myWidth, self.MyImage.frame.size.height + 30 * myHeight, self.contentView.frame.size.width - 110 * myWidth, 50 * myHeight);
    
    self.addressLabel.frame = CGRectMake(120 * myWidth, self.MyImage.frame.size.height + 30 * myHeight + self.titleLabel.frame.size.height, self.contentView.frame.size.width - 240 * myWidth, 20 * myHeight);
    
    self.timeLabel.frame = CGRectMake(135 * myWidth, self.MyImage.frame.size.height + 30 * myHeight + self.titleLabel.frame.size.height + self.addressLabel.frame.size.height, self.contentView.frame.size.width - 270 * myWidth, 20 * myHeight);
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    
    [super setSelected:selected animated:animated];

}

@end
